/**
 * 
 */
package com.eya.controller;

import java.util.HashMap;
import java.util.Map;

import org.apache.log4j.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author Administrator
 *
 */
@Controller
@RequestMapping("ajax")
public class AjaxController {

	private static final Logger LOGGER = Logger.getLogger(AjaxController.class);

	/**
	 * 通过注解@ResponseBody返回JSON数据
	 * 
	 * @return
	 */
	@RequestMapping("getdatabyresponsebody.json")
	public @ResponseBody Map<String, Object> getAjaxDataByResponseBody() {
		LOGGER.info("【通过注解@ResponseBody返回JSON数据】");
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("success", true);
		map.put("message", "Successfully returning the data.");
		return map;
	}

}
